package cn.funnyxb.powerremember.db.tables;

import android.database.Cursor;
import cn.funnyxb.powerremember.beans.AlarmInfo;
import cn.funnyxb.tools.appFrame.database.DBHolder;
import cn.funnyxb.tools.appFrame.database.DBService;
import cn.funnyxb.tools.appFrame.database.TableHolder;
import java.util.ArrayList;

public class Tbholder_alarmsinfo extends TableHolder
{
  private boolean inited = false;

  public Tbholder_alarmsinfo(DBHolder paramDBHolder)
    throws Exception
  {
    super(paramDBHolder, "alarms");
    if (this.inited)
      throw new Exception("has inited!");
    this.inited = true;
  }

  public void delByTaskId(int paramInt)
  {
    DBService localDBService = this.dbHolder.getDbService();
    Object[] arrayOfObject = new Object[1];
    arrayOfObject[0] = Integer.valueOf(paramInt);
    localDBService.execSql("delete  from alarms where taskid = ? ", arrayOfObject);
  }

  public void insertARecord(int paramInt, AlarmInfo paramAlarmInfo)
  {
    String str = "insert  into " + this.tableName + " ( " + "isenable" + " ," + "isworkonlywhendelay" + " ," + "memo" + " ," + "repeat" + " ," + "taskid" + " ," + "type" + " ," + "time" + " ) values (?,?,?,?,?,? ,?)";
    DBService localDBService = this.dbHolder.getDbService();
    Object[] arrayOfObject = new Object[7];
    arrayOfObject[0] = Boolean.valueOf(paramAlarmInfo.isEnabled());
    arrayOfObject[1] = Boolean.valueOf(paramAlarmInfo.isWorkOnlyWhenDelay());
    arrayOfObject[2] = paramAlarmInfo.getMemo();
    arrayOfObject[3] = Integer.valueOf(paramAlarmInfo.getRepeatValue());
    arrayOfObject[4] = Integer.valueOf(paramInt);
    arrayOfObject[5] = Integer.valueOf(paramAlarmInfo.getAlarmType());
    arrayOfObject[6] = Integer.valueOf(paramAlarmInfo.getTime());
    localDBService.execSql(str, arrayOfObject);
  }

  public ArrayList<AlarmInfo> queryByTaskId(int paramInt)
  {
    DBService localDBService = this.dbHolder.getDbService();
    String[] arrayOfString = new String[1];
    arrayOfString[0] = paramInt;
    Cursor localCursor = localDBService.query("select * from alarms where taskid = ? ", arrayOfString);
    if (localCursor == null);
    for (Object localObject = null; ; localObject = null)
    {
      return localObject;
      if (localCursor.getCount() != 0)
        break;
      localCursor.close();
    }
    ArrayList localArrayList = new ArrayList();
    localCursor.moveToFirst();
    while (true)
    {
      if (localCursor.isAfterLast())
      {
        localCursor.close();
        localObject = localArrayList;
      }
      localArrayList.add(AlarmInfo.parseFromCursor(localCursor));
      localCursor.moveToNext();
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.db.tables.Tbholder_alarmsinfo
 * JD-Core Version:    0.5.3
 */